import { http } from "../plugins/axios";
//警情数据概览
export interface HomeInfo {
  jingQingBi: JingQingBI;
  chuJingPaiMing: PaiMing;
  xingShiLeiBiePaiMing: PaiMing;
  zhiAnLeiBiePaiMing: PaiMing;
  totalCount: null;
  deptName: null;
  count: null;
}

export interface PaiMing {
  deptName: string[];
  count: number[];
}

export interface JingQingBI {
  接警数: string;
  处警数: string;
  刑事警情: string;
  治安警情: string;
  交通警情: string;
  纠纷警情: string;
  求助警情: string;
}
//警情数据概览发送参数接口
export interface HomeParam {
  startDate: string;
  endDate: string;
}

//警情指标查询返回信息接口
export interface jingqingInfo {
  totalCount: string;
  deptName: string[];
  count: number[];
}

//指标查询发送参数接口
export interface ZhibiaoParam {
  startDate: string;
  endDate: string;
  zhiBiao: string;
}

//接警查询返回信息接口
export interface jiejingInfo {
  resultList: jiejingResultList[];
  totalCount: number;
}

export interface jiejingResultList {
  接警单编号: string;
  接警单位: string;
  接警员: string;
  报警时间: string;
  报警人: string;
  报警人电话: string;
  联系地址: string;
  案由: string;
  报警内容: string;
}
//接警查询发送信息接口
export interface jiejingParam {
  startDate: string;
  endDate: string;
  chuJingDanWei: string;
  callName?: string;
  content?: string;
  pageSize: number;
  currentPage: number;
}

//处警查询返回信息接口
export interface ChujingInfo {
  totalCount: number;
  resultList: ChujingResultList[];
}

export interface ChujingResultList {
  接警单编号: string;
  处警单位: string;
  处警员: string;
  处警时间: string;
  报警时间: string;
  报警人: string;
  报警人电话: string;
  联系地址: string;
  案由: string;
  报警内容: string;
}
//处警查询发送信息接口
export interface ChujingParam {
  startDate: string;
  endDate: string;
  callName?: string;
  content?: string;
  pageSize: number;
  currentPage: number;
  chuJingDanWei: string;
}

class jingqingApi {
  
   //获取警情数据概览查询结果
  getHomeInfo(param: HomeParam) {
    return http.request<HomeInfo>({
      url: "/api/JingQing/GetJingQingZhiBiao",
      method: "post",
      params: param,
    });
  }
  //获取警情指标查询结果
  getZhibiaoInfo(param: ZhibiaoParam) {
    return http.request<jingqingInfo>({
      url: "/api/JingQing/GetZhiBiao",
      method: "post",
      params: param,
    });
  }

  //获取接警信息查询结果
  getJiejingInfo(param: jiejingParam) {
    return http.request<jiejingInfo>({
      url: "/api/JingQing/GetJieJingData",
      method: "post",
      params: param,
    });
  }

  //获取处警信息查询结果
  getChujingInfo(param: ChujingParam) {
    return http.request<ChujingInfo>({
      url: "/api/JingQing/GetChuJingData",
      method: "post",
      params: param,
    });
  }
}

export default new jingqingApi();
